package com.share.thread;

import java.util.*;

/**
 * 
 * @author Johnny Tam Yield Demo
 */
public class TestPriorityDemo {
	public static void main(String args[]) {

		Thread t1 = new Thread(new Thread1());
		Thread t2 = new Thread(new Thread2());

		t2.start();
		
		t1.setPriority(Thread.MAX_PRIORITY);
		System.out.println("MAX_PRIORITY = " + Thread.MAX_PRIORITY);
		t1.start();
		

	}
}

class Thread1 implements Runnable {
	public void run() {
		for (int i = 0; i < 1000; i++) {
			System.out.println("T1: " + i);
		}
	}
}

class Thread2 implements Runnable {
	public void run() {
		for (int i = 0; i < 1000; i++) {
			System.out.println("------T2: " + i);
		}
	}
}